import { Controller } from "egg";
export default class UserController extends Controller {
  /**
   * 登录
   * @returns {UserInfo}
   * */
  public async Login() {
    const { ctx } = this;
    // ctx.body = "<h1>" + (await ctx.service.app.user.getUserInfo()) + "</h1>";
    ctx.body = await ctx.service.admin.user.Login();
  }
  // 退出登录
  public async loginOut() {
    // 清理cookie
    const { ctx } = this;

    ctx.body = await ctx.service.admin.user.LogOut()

    // 重定向
  }
  /**
   * 获取用户信息
   * @returns {UserInfo}
   * */
  public async getUserInfo() {
    const { ctx } = this;

    // ctx.body = "<h1>" + (await ctx.service.app.user.getUserInfo()) + "</h1>";
    ctx.body = await ctx.service.admin.user.getUserInfo();
  }

}
